import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';

class GoodsSearchController extends GetxController{
  late TextEditingController controller;

  RxBool showDelete = false.obs;

  @override
  void onInit() {
    super.onInit();
    controller = TextEditingController();
    controller.addListener(() {
      if(controller.text.isNotEmpty){
        showDelete.value  = true;
      }else{
        showDelete.value = false;
      }
    });
  }

  ///清楚输入框内容
  void deleteController(){
    controller.clear();
    showDelete.value  = false;
  }
}